<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	template="/member/layout/contentLayout.xhtml">

	<!-- 页面标题 -->
	<ui:param name="param_pageTitle" value="路远商城->我的积分" />
	<ui:param name="my" value="true" />

	<ui:define name="navigation">
		<a href="http://www.luyuansc.com/">路远商城</a> 
		&gt; 
		我的积分
	</ui:define>

	<ui:define name="jsScripts">
		<script src="#{facesContext.externalContext.requestContextPath}/js/table.js" type="text/javascript"></script>
	</ui:define>

	<ui:define name="content">
	
		<div class="main clear">
			<div class="sidebar">
				<ui:include src="layout/nav.xhtml" />
			</div>
			<div class="middle">
				<h:panelGroup  id="message" >
				<h:messages errorClass="msg ERROR" infoClass="msg INFO" warnClass="msg WARN" escape="true"/>
				</h:panelGroup>
				<rg:titlePanel headerTitle="我的积分" >
					<rg:fieldSet>
						<rg:outputText id="memNumber" label="#{messages.luyuan_member_memNumber}" value="#{memberAction.memberModel.account.username}"/>
						<rg:outputText id="memberLevel"
							value="#{memberAction.memberModel.memberIntegral.memberLevel}" converter="#{memberLevelConverter}" label="会员等级" >
							<ui:define name="tip">
								<h:panelGroup class="tip" layout="block" >
									<a href="help/integral.jsf" style="color:blue;">积分规则</a>
								</h:panelGroup>
							</ui:define>
						</rg:outputText>
								<h:form>
						<rg:outputText id="currentIntegral"
							value="#{memberAction.memberModel.memberIntegral.currentIntegral}" label="可用积分"  >
							<ui:define name="tip">
								<h:panelGroup id="currentIntegralReceived" class="tip" layout="block" >
										<h:outputLabel value="当前还剩余#{memberIntegralReceivedAction.integral}积分未领取，"  rendered="#{memberIntegralReceivedAction.integral gt 0}"/>
										<a:commandLink value="立即领取" actionListener="#{memberIntegralReceivedAction.receiveMemberIntegral()}"
											immediate="true" style="color:blue" reRender="memberIntegralRecord_titlePanel,currentIntegralReceived,message"  rendered="#{memberIntegralReceivedAction.integral gt 0}" />
								</h:panelGroup>
							</ui:define>
						</rg:outputText>
								</h:form>
<!--						<rg:outputText id="email" value="#{memberAction.memberModel.memberIntegral.totalIntegral}"-->
<!--							label="累计积分" />-->
						<rg:outputText id="name"
							value="#{memberAction.memberModel.memberIntegral.discount * 10}折" label="享受折扣" />
					</rg:fieldSet>
				</rg:titlePanel>

				<rg:titlePanel headerTitle="我的客服"  style="margin-top:10px;margin-bottom:10px;">
					<rg:fieldSet>
						<rg:outputText id="cs_userName"
							value="#{memberAction.memberModel.support.userName}" label="客户专员" />
						<rg:outputText id="cs_telephone"
							value="#{memberAction.memberModel.support.telephone}" label="联系方式" />
					</rg:fieldSet>
				</rg:titlePanel>

				<rg:titlePanel id="memberIntegralRecord" headerTitle="积分记录" style="margin-top: 10px;" >
					<h:form>
	                    <rg:table id="orderTable" value="#{memberIntegralRecordAction.tableModel}"
	                        var="item">
							<rg:column property="usedTime" title="时间" converter="#{dateConverter}" datePattern="yyyy-MM-dd" headerStyle="width:80px" />
	                        <rg:column property="integral" title="变更积分" headerStyle="width:80px"  />
	                        <rg:column property="totalIntegral" title="积分结余" headerStyle="width:80px"  />
	                        <rg:column property="usedDetail" title="变更原因" />
	                    </rg:table>
					</h:form>
				</rg:titlePanel>
			</div>
		</div>	
	</ui:define>

</ui:composition>